{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "FCInv=25000\n",
    "NWCInv=5000\n",
    "\n",
    "S=0\n",
    "C=-8000\n",
    "D_1=7920-1000\n",
    "D_2=10800-1000\n",
    "D_3=3600-1000\n",
    "D_4=1680-1000\n",
    "D_5=0-1000\n",
    "T=0.40\n",
    "\n",
    "Sal_0=3000\n",
    "B_0=5000\n",
    "\n",
    "Sal_T=5000\n",
    "B_T=0\n",
    "\n",
    "Rate=0.15\n",
    "\n",
    "\n",
    "def Calculate_Initial_Stage_Out_Flow(FCInv,NWCInv):\n",
    "    Initial_Stage_Out_Flow=FCInv+NWCInv\n",
    "    return -Initial_Stage_Out_Flow\n",
    "\n",
    "def Calculate_CFO(S,C,T,D):\n",
    "    CFO=(S-C)*(1-T)+T*D\n",
    "    return CFO\n",
    "\n",
    "def Calculate_TNOCF(NWCInv,Sal_T,T,B_T):\n",
    "    TNOCF=Sal_T-T*(Sal_T-B_T)+NWCInv\n",
    "    return TNOCF\n",
    "\n",
    "def Calculate_Terminating_Stage_In_Flow(OCF_T,TNOCF):\n",
    "    Terminating_Stage_In_Flow=OCF_T+TNOCF\n",
    "    return Terminating_Stage_In_Flow\n",
    "\n",
    "\n",
    "Calculate_Initial_Stage_Out_Flow(FCInv,NWCInv)\n",
    "\n",
    "Calculate_CFO(S,C,T,D_1)\n",
    "Calculate_CFO(S,C,T,D_2)\n",
    "Calculate_CFO(S,C,T,D_3)\n",
    "Calculate_CFO(S,C,T,D_4)\n",
    "\n",
    "Calculate_TNOCF(NWCInv,Sal_T,T,B_T)\n",
    "\n",
    "\n",
    "CF_LIST=[Calculate_Initial_Stage_Out_Flow(FCInv,NWCInv),Calculate_CFO(S,C,T,D_1),Calculate_CFO(S,C,T,D_2)\n",
    "            ,Calculate_CFO(S,C,T,D_3),\n",
    "            Calculate_Terminating_Stage_In_Flow(Calculate_CFO(S,C,T,D_4),Calculate_TNOCF(NWCInv,Sal_T,T,B_T))]\n",
    "np.npv(Rate,CF_LIST)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "name": "pycharm-9607c1d0",
   "language": "python",
   "display_name": "PyCharm (sklearn)"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}